# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=scrcpy
pkgver=1.16
pkgrel=0
pkgdesc="Display and control your Android device"
url="https://github.com/Genymobile/scrcpy"
arch="all !s390x !ppc64le !mips !mips64" # limited by android-tools
license="Apache-2.0"
options="!check" # no test suite
depends="android-tools"
makedepends="ffmpeg-dev mesa-dev meson sdl2-dev"
subpackages="$pkgname-doc"
source="scrcpy-$pkgver.tar.gz::https://github.com/Genymobile/scrcpy/archive/v$pkgver.tar.gz
	https://github.com/Genymobile/scrcpy/releases/download/v$pkgver/scrcpy-server-v$pkgver"

build() {
	abuild-meson \
		-Dcompile_server=false \
		-Dprebuilt_server=/usr/share/scrcpy/scrcpy-server-v$pkgver \
		. output
	ninja -C output
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
	install -Dm644 "$srcdir"/scrcpy-server-v$pkgver \
		"$pkgdir"/usr/share/scrcpy/scrcpy-server
}

sha512sums="e50903e3be3f822e2bf8c873b636aef87e83122d65f48159345dab36cc352f56b019aa528181458f2b1a3043938ce96e0a35ba51c12a5e2bec8bdaedfb20914c  scrcpy-1.16.tar.gz
52d4fbf48a91e61abff5e0bbc510c83fb4c1238a2791f888baf9fb04f04c5c19dfc82525c717fc1b92bd86fb2152cb29f6932784e1e2115329288ec97d8594fc  scrcpy-server-v1.16"
